<?php

use Faker\Generator as Faker;

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/

$factory->define(App\User::class, function (Faker $faker) {
    static $password;

    return [
        'name' => $faker->name,
        'email' => $faker->unique()->safeEmail,
        'password' => $password ?: $password = bcrypt('secret'),
        'remember_token' => str_random(10),
    ];
});



$factory->define(\App\Category::class ,function(Faker $faker){
    static $i = 0 ;
    $i ++ ;
    return [
        'name' => "第{$i}堂课视频教程" ,
        'pid'  => 0 ,
        'thumb' => 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1668601343,2172718653&fm=200&gp=0.jpg',
        'description' => 'Laravel 5.5 正式版发布在即，又到了我们来学习新特性的时候了，本系列视品教程。。。。。。。。。。。。。打滴滴',
        'total_time' => 120 + $i ,
        'nums' => 10 + $i ,
    ];
});